package com.example.mymall.repository.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mymall.dao.GoodsMapper;
import com.example.mymall.entity.GoodsEntity;
import com.example.mymall.entity.UserEntity;
import com.example.mymall.entity.UserGoodsCartVO;
import com.example.mymall.repository.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    public Page<GoodsEntity> selectGoodsPage(int currentPage, int pageSize){
        Page<GoodsEntity> page = new Page<>(currentPage, pageSize);
        return goodsMapper.selectPage(page, null);
    }

    public List<UserGoodsCartVO> test() {
        return goodsMapper.selecttext();
    }
}
